﻿using UnityEngine;
using System;
using System.Collections;
using Hont.C2UTool;

public class C2UStaticInfoCustomMaterialSyncer : MonoBehaviour, IC2UStaticInfoReceiver
{
    public string materialPath;


    public void OnStaticInfoReplaced(GameObject root)
    {
        var meshRenderer = gameObject.GetComponent<MeshRenderer>();

        if (meshRenderer != null)
        {
            meshRenderer.sharedMaterial = Resources.Load<Material>(materialPath);
        }

        DestroyImmediate(this);
    }

    public void OnStaticInfoReplacedLate(GameObject root)
    {
    }
}
